home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / EGAVGA.SWG / 0076_Color Bars.pas < prev    next >
Pascal/Delphi Source File  |  1994-01-27  |  1KB  |  42 lines

  1. {
  2. > im coding a program at the moment that needs to have a scrolly bar
  3. > menu. I have got all the movement's worked out, however! I cannot
  4. > work out how to have some sort of bar (like in PowerMenu)... you press
  5. > enter when the scrolly bar hits your desired selection and it
  6. > executes another procedure or function...
  7.  
  8. As I understand your problem, you need to know how to display a bar on
  9. the screen where the screen and text have different colors, and then,
  10. after moving away, restore the original colors in that bar. I hope
  11. you have found out how to handle the cursor keys.
  12. ... searching for routines ... loading ... clipping
  13. }
  14.  
  15. Procedure Colorbar(X,Y,Count: Word;Color: Byte); Assembler;
  16. Asm
  17.   MOV AX,80
  18.   MUL Y
  19.   ADD AX,X
  20.   SHL AX,1
  21.   INC AX
  22.   MOV DI,AX
  23.   MOV AX,Vidseg
  24.   MOV ES,AX
  25.   MOV CX,Count
  26.   MOV AL,Color
  27. @@1: STOSB
  28.      INC DI
  29.    LOOP @@1
  30. End;
  31. {
  32.  
  33. Give that procedure the vidseg ($B000 for Hercules or $B800 for the rest),
  34. then call it. It sets a part of the screen to the color given to it.
  35. The color values are 16*Backgroundcolor + Forgroundcolor, using the
  36. color constants of the unit CRT. Add $80 to get it blink.
  37. To delete the bar, just set the neutral color you have used while drawing
  38. the screen.
  39. BTW, there is no error checking in that routine, so giving bad values will
  40. cause problems. You can use it for painting many lines by giving a larger
  41. "count" parameter to it.
  42. }